package dao;

import java.io.Serializable;
import java.util.List;

import modelo.TipoEvento;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;

import util.HibernateUtil;

public class TipoEventoDao implements Serializable{

	private static final long serialVersionUID = 5301549197518907421L;

	private Session session;
	SessionFactory sessionFactory = HibernateUtil.getSessionFactory();
	
	public TipoEventoDao() {
		super();
	}
	
	public List<TipoEvento> obtenerTipoEvento() {
		session=sessionFactory.openSession();
		
		Query query = session.createQuery("SELECT t FROM TipoEvento t");
		List<TipoEvento> t = query.list();
		
		session.close();
		
		return t;
	}
}
